<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>注册 - <{$setting.title}></title>
		<meta content="<{$setting.keywords}>"  name="keywords"/>
		<meta content="<{$setting.description}>" name="description"/>
		<link href="<{$weburl}>/templates/default/<{$setting.templates}>/css/user.css" rel="stylesheet" type="text/css"/>
		<script type="text/javascript" src="<{$weburl}>/static/js/jquery.js"></script>
		<script type="text/javascript" src="<{$weburl}>/static/js/Validform_v5.3.2_min.js"></script>
		<script type="text/javascript">
		$(document).ready(function() {
			//城市选择
			<{if $setting.version==3}>
			$("#province").bind("change", function(){
				$.get("<{$weburl}>/index.php?m=ajax&ajax=1", {
					cityid :  $("#province").val()
				}, function (data, textStatus){
					$("#city").html(data); // 把返回的数据添加到页面上
				}) ;
			})   ;
			$("#province2").bind("change", function(){
				$.get("<{$weburl}>/index.php?m=ajax&ajax=1", {
					cityid :  $("#province2").val()
				}, function (data, textStatus){
					$("#city2").html(data); // 把返回的数据添加到页面上
				}) ;
			})   ;
			<{/if}>
			//表单验证
			$(".resform").Validform({
				tiptype:3
			});
			$div_li = $("ul.reg_tab li");
			$div_li.click(function() {
				$(this).addClass("here").siblings().removeClass("here");
				var index = $div_li.index(this);
				$("div.regbox > div").eq(index).show().siblings().hide();
			});
		});
		</script>
	</head>
	<body>
		<!--内容-->
		<{include file="default/`$setting.templates`/head.html"}>
		<div class="login_main mt10">
			<div class="title">注册</div>
			<div class="clearfix">
				<div class="login_left">
					<div class="regbox mt20">
						<div>
							<form name="loginform" class="resform" id="loginform" method="post" action="<{$weburl}>/<{if $setting.ishtml==1}>register/<{else}>index.php?m=register<{/if}>" >
							<table class="logintable">
							<tr>
								<th>手机号：</th>
								<td id="mobilephone"><input type="text" name="mobilephone" class="inp01" datatype="m" ajaxurl="<{$weburl}>/index.php?m=register&ajax=1" sucmsg="手机号验证通过！" nullmsg="请输入手机号！" errormsg="请输入正确的手机号！"/></td>
							</tr>
							<tr>
								<th>密码：</th>
								<td><input type="password"  name="password" class="inp01"/></td>
							</tr>
							<{if $setting.version==3}>
							<tr>
							<th> 所在城市：</th>
							<td colspan="3">
								<select name="aid" id="province2" datatype="n" nullmsg="请选择省份！">
									<{$selectprovince}>
								</select>
								<select name="cid" id="city2" datatype="n" nullmsg="请选择城市！">
									<option>请选择城市</option>
								</select>
							</td>
							</tr>
							<{/if}>
							<tr>
								<th>邮箱：</th>
								<td><input type="text" name="email" class="inp01" datatype="e" ajaxurl="<{$weburl}>/index.php?m=register&ajax=1" nullmsg="请输入邮箱地址！" errormsg="请输入正确的邮箱地址！"/></td>
							</tr>
							<tr>
								<th>姓名/称呼：</th>
								<td><input type="text" name="nicname" class="inp01"  datatype="s" nullmsg="请填写联系人！"/></td>
							</tr>
							<tr>
								<th>公司名称：</th>
								<td><input type="text" name="company" class="inp01"  datatype="s" nullmsg="请填写公司名称！"/></td>
							</tr>
							<tr>
								<th width="20%">验证码：</th>
								<td>
									<span class="fl">
                                        <input name="code"  type="text" class="inp02" datatype="s" nullmsg="请输入验证码！"/>
                                    </span>
                                    <span class="fl pt5">
                                        <botton class="checkcode" st="1">获取验证码</botton>
                                    </span>
                                </td>
							</tr>
							<tr>
								<th></th>
								<td><input type="submit" class="login_but" value="注册">  <input type="hidden" name="action" value="register"><input type="hidden" name="isdealer" value="2"></td>
							</tr>
						</table>
						</form>
						</div>
					</div>
				</div>
				<div class="login_right">
					<p class="f14 mt20"><{$setting.sitename}></p>
					<p class="mt20"><a href="<{$weburl}>/<{if $setting.ishtml==1}>login/<{else}><{$weburl}>/index.php?m=login<{/if}>" class="register_but">我要登录</a></p>
				</div>
			</div>
		</div>
		<!--版权-->
		<{include file="default/`$setting.templates`/foot.html"}>
	</body>
</html>
<script>

     var wait = 120;
    function time(o) {
        if (wait == 0) {
            o.html('重新获取验证码');
            o.attr('st',1);
            wait = 120;
        } else {
            o.html("发送中...(" + wait + ")");
            o.attr('st',2);
            wait--;
            setTimeout(function () {
                        time(o)
                    },
                    1000)
        }
    }
    $('.checkcode').click(function () {
        var tel = $("input[name='mobilephone']").val();
        var url = "<{$web_domain}>/index.php?m=sms";
        if($(this).attr('st')==1){
            if(!tel){
                alert('请填写手机号');
                return false;
            }
            if(!$('#mobilephone .Validform_checktip').hasClass('Validform_right')){
                alert('手机号验证失败');
                return false;
            }
            $.post(url, { mobile: tel, a: "register",type:1 },
                    function(data){
                        if(data.succ==='false'){
                            alert(data.msg);
                        }else{
                            time($('.checkcode'));
                        }
                    },"json");

        }
    })

</script>